public class Q {
        public static void main(String args[]){
            System.out.println("输入数字：");
            Scanner reader0 = new Scanner(System.in);
            double x = reader0.nextDouble();
            double sum = 0;
            while ((x!=0)){
                sum = sum + x;
                x = reader0.nextDouble();
            }
            System.out.println("sum ="+sum);
        }
    }


